package com.example.controller;

import com.example.exception.AppException;
import com.example.model.AppExceptioncodeMsg;
import com.example.model.Resp;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ExceptionController {


    @GetMapping("test1")
    public Resp<String> test1() {
        return Resp.success("成功！");
    }

    @GetMapping("test2")
    public Resp<String> test2() {
        throw new AppException(AppExceptioncodeMsg.INVALID_CODE);
    }

    @GetMapping("test3")
    public Integer test3() {
        int i=1/0;
        return  i;
    }
}
